package com.itheima.string;

import java.util.Scanner;

public class StringMethod04 {
    /*
    实现键盘录入一个字符串,统计其中大写字母.小写字母.和数字总共有多少个
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入");
        String s = sc.next();
        char[] arr = s.toCharArray();
        int bigCount = 0;
        int smallCount = 0;
        int numCount = 0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] >= 'A' && arr[i] <= 'Z'){
                bigCount++;
            }else if(arr[i] >= 'a' && arr[i] <= 'z'){
                smallCount++;
            }else if(arr[i] >= '0' && arr[i] <= '9'){
                numCount++;
            }
        }
        System.out.println("大写字母字符有"+bigCount+"个");
        System.out.println("小写字母字符有"+smallCount+"个");
        System.out.println("数字字符有"+numCount+"个");
    }
}
